<!-- TOP NAVIGATION -->
    <div id="topMenu">
        <!--Corner/Side Divs-->
            <div class="topMenu-Top">
            <div class="topMenu-Bot">
            <div class="topMenu-Left">
            <div class="topMenu-Right">
            <div class="topMenu-BotL">
            <div class="topMenu-BotR">
            <div class="topMenu-TopL">
            <div class="topMenu-TopR">
	<!--Corner/Side Divs-->

	<table width="100%" border="0" cellpadding="1" cellspacing="1" align="center">
            <tr>
		<td class="highlightCell" align="center"><a href="index.php"><strong>Home</strong></a></td>
		<td class="highlightCell" align="center"><a href="browse.php"><strong>Browse</strong></a></td>
		<?php 
                	if (isset($_SESSION["username"]))
                        {
		?>
                        	<td class="highlightCell" align="center"><a href="my_profile.php"><strong>My Profile</strong></a></td>
		<?php
			} else {
		?>
				<td class="highlightCell" align="center"><a href="register.php"><strong>Register</strong></a></td>
		<?php
			}	
		?>
				<td class="highlightCell" align="center"><a href="support.php"><strong>Support</strong></a></td>
            </tr>
	</table>

	<!--Corner/Side Divs-->
            </div></div></div></div></div></div></div></div>
	<!--Corner/Side Divs-->
	</div>
</div> <!-- End of topSection -->


<?php
    //LEFT NAVIGATION
    //Current page values: index, browse, my_profile
    function printLeftMenu($currentPage)
    {
?>
        <div id="leftMenu">
        <!--Corner Divs-->
            <div class="leftMenu-BotL">
            <div class="leftMenu-BotR">
            <div class="leftMenu-TopL">
            <div class="leftMenu-TopR">
        <!--Corner Divs-->
        
        <?php		
            $menuItems = array();

            if (isset($_SESSION['username']))
            {
                $menuItems["intro"] = "<tr align='right'><td><strong>Hi " . $_SESSION['username'] . "!</td></tr>";
                $menuItems["my_profile"] = "<tr align='right'><td><a class='normalMenuItem' href='my_profile.php'>My Profile</a></td></tr>";
                $menuItems["my_software"] = "<tr align='right'><td><a class='normalMenuItem' href='my_software.php'>My Software</a></td></tr>";
                $menuItems["my_projects"] = "<tr align='right'><td><a class='normalMenuItem' href='my_projects.php'>My Projects</a></td></tr>";
                
                if ($_SESSION['userLevel'] >= 3)
                {
                    $menuItems["admin"] = "<tr align='right'><td><strong>Admin functions:</td></tr>";
                    $menuItems["manage_users"] = "<tr align='right'><td><a class='normalMenuItem' href='manage_users.php'>Manage Users</a></td></tr>";
                    $menuItems["manage_content"] = "<tr align='right'><td><a class='normalMenuItem' href='manage_content.php'>Manage Content</a></td></tr>";
                }
                
                $menuItems["logout"] = "<tr align='right'><td><a class='normalMenuItem' href='logout.php'>Logout</a></td></tr>";
                     
		if (empty($currentPage))
                {
                    $menuItems[$currentPage] = str_replace("class='normalMenuItem'", "class = 'currentPageMenuItem'", $menuItems[$currentPage]);
		}
                
                echo "<table border='0' cellpadding='2' cellspacing='2' width='96%'>";
		foreach ($menuItems as $key => $value)
                {
                    echo $value;
		}
                echo "</table>";
            }
            else
            {
        ?>                
                <form name="loginForm" id="loginForm" action="login.php" method="post" onsubmit="return check_login_form()">
                <strong>Username</strong>
                <input type="text" name="username" id="username" value="" size="5" />
                <p></p>
                <strong>Password</strong>
                <input type="password" name="password" id="password" value="" size="15" />
                <input type="submit" name="loginSubmit" value="Login" />
                </form>
        <?php
            }
        ?>
            <!--Corner Divs-->
                </div></div></div></div>
            <!--Corner Divs-->
        </div>
<?php
    }
?>